﻿@model FCDB.Entity.FormCDB
@using FB.Extensions;
@{
    ViewBag.Title = "担保流程审批表";
    Layout = "~/Views/Shared/_FormLayout.cshtml";
    var IsViewMode = Model.Status != (short)FCDB.Entity.FormStatusEnum.Empty && Model.Status != (short)FCDB.Entity.FormStatusEnum.Draft;

}
@section HeadIncluder
{
    <link href='@Url.Content("~/Content/public.css")' rel="stylesheet" />
    <link href='@Url.Content("~/Content/con_style.css")' rel="stylesheet" />
}  
@{
    Html.RenderPartial("UCFormButtonBar", Model);
}
<div class="frombox" id="formMain">
    <div class="from_l" style="background: #fff;">
        <div class="left_con_f PrintArea">
            <input type="hidden" id="hFormTitle" value="@(Model!=null?Model.FormTitle:"")" />
            <div align="center" class="left_f_tit">诉讼业务申请表</div>
            @using (Html.BeginForm("SaveFormCDB", "Form", FormMethod.Post, new { id = "frm" }))
            {
                Html.RenderPartial("UCHiddenArea");
                <table width="100%" class="left_xx">
                    <tr>
                        <td class="text_w" align="center">
                            流程名称：
                        </td>
                        <td colspan="5">
                            @if (IsViewMode)
                            {
                                @Model.FormTitle
                            }
                            else
                            {
                                <input id="txtFormTitle" style="width:98%;" class="validate[required] in_c1 " type="text" name="FormTitle" value="@Model.FormTitle" />
                            }
                        </td>
                    </tr>
                    <tr>
                        <td class="text_w" align="center" style="width: 66px">审批序号</td>
                        <td colspan="3">
                            @if (IsViewMode)
                            {
                                @Model.AppInstanceID
                            }
                            else
                            {
                                <input type="text" style="width:66px" value="" placeholder="提交后生成" readonly="readonly" class="in_c1" />
                            }
                        </td>
                    </tr>
                        <tr>
                        <td class="text_w" align="center">申请部门</td>
                        <td colspan="1">
                            @if (IsViewMode)
                            {
                                @ViewBag.DepartmentName
                            }
                            else
                            {
                                <input type="text" disabled="disabled" style="width:100px" id="DepartmentName" class="in_c1" value="@ViewBag.DepartmentName" name="DepartmentName" />
                                <input id="DepartmentID" type="hidden" name="DepartmentID" value="@Model.DepartmentID" />
                            }
                        </td>
                        <td class="text_w" align="center">流程申请人</td>
                        <td colspan="1">
                            @if (IsViewMode)
                            {
                                @ViewBag.UserName
                            }
                            else
                            {
                                <input type="text" class="in_c1" style="width:100px" disabled="disabled" id="UserName" name="UserName" value="@ViewBag.UserName" />
                                <input id="ApplyUserID" type="hidden" name="ApplyUserID" value="@Model.ApplyUserID" />
                            }
                        </td>
                        <td class="text_w" align="center">业务员</td>
                        <td colspan="1">
                            @if (IsViewMode)
                            {
                                @ViewBag.Salesman
                            }
                            else
                            {
                                <input type="text" class="in_c1" style="width:70px" id="ShowSalesman" readonly="readonly" name="ShowSalesman" value="@ViewBag.Salesman" />
                                <input id="Salesman" type="hidden" name="Salesman" value="@Model.Salesman" />
                                <a href="javascript:void(0)" class="btn_c3 " onclick="addUsers()">添加</a>
                            }
                        </td>
                    </tr>

                    
                    <tr>
                        <td class="text_w" align="center">协议保函编号</td>
                        <td>
                            @if (IsViewMode)
                            {
                                @Model.pact_no
                            }
                            else
                            {
                                <input type="text" id="pact_no" name="pact_no" readonly="readonly" class="in_c1 " style="width:98%" value="@Model.pact_no" />
                            }
                        </td>
                        <td class="text_w" align="center">案号</td>
                        <td>
                            @if (IsViewMode)
                            {
                                @Model.CaseNumber
                            }
                            else
                            {
                                <input type="text" id="CaseNumber" name="CaseNumber" class="in_c1 " style="width:98%" value="@Model.CaseNumber" />
                            }
                        </td>
                        <td class="text_w" align="center">仲裁案号</td>
                        <td>
                            @if (IsViewMode)
                            {
                                @Model.ArbitrationNumber
                            }
                            else
                            {
                                <input type="text" id="ArbitrationNumber" name="ArbitrationNumber" placeholder="非必填" class=" in_c1 " style=" width:98%" value="@Model.ArbitrationNumber" />
                            }
                        </td>
                    </tr>
                    <tr>
                        <td class="text_w" align="center">担保申请人<a style="color:red;position:relative; top:3px">*</a></td>
                        <td colspan="5">
                            @if (IsViewMode)
                            {
                                @Model.ApplyUser
                            }
                            else
                            {
                                <input type="text" id="ApplyUser" name="ApplyUser" placeholder="多个申请人用、相隔 例如 张三、李四 " class="validate[required] in_c1 " style="width:98%" value="@Model.ApplyUser" onchange="createApplyGuarantee()" onblur="applyUserChange()" />
                            }
                        </td>
                    </tr>
                    <tr>
                        <td class="text_w" align="center">被申请人<a style="color:red;position:relative; top:3px">*</a></td>
                        <td colspan="5">
                            @if (IsViewMode)
                            {
                                @Model.Respondent
                            }
                            else
                            {
                                <input type="text" id="Respondent" name="Respondent" placeholder="多个申请人用、相隔  例如 张三、李四 " class="validate[required] in_c1 " style="width:98%" value="@Model.Respondent" onchange="createApplyGuarantee()" />
                            }
                        </td>
                    </tr>
                    <tr>
                        <td class="text_w" align="center">案由</td>
                        <td colspan="2">
                            @if (IsViewMode)
                            {
                                @Model.CauseOfAction
                            }
                            else
                            {
                                <input type="text" id="CauseOfAction" name="CauseOfAction" class=" in_c1 " style="width:98%" value="@Model.CauseOfAction" onchange="createApplyGuarantee()" />
                            }
                        </td>
                        <td class="text_w" align="center">所属法院<a style="color:red;position:relative; top:3px">*</a></td>
                        <td colspan="2">
                            @if (IsViewMode)
                            {
                                @Model.Court
                            }
                            else
                            {
                                <select id="Court" name="Court" class="validate[required] in_c1" style="width:200px">
                                    <option value="深圳市盐田区人民法院" @(Model.Court == "深圳市盐田区人民法院" ? "selected=selected" : "")>深圳市盐田区人民法院</option>
                                    <option value="深圳市中级人民法院" @(Model.Court == "深圳市中级人民法院" ? "selected=selected" : "")>深圳市中级人民法院</option>
                                    <option value="深圳前海合作区人民法院" @(Model.Court == "深圳前海合作区人民法院" ? "selected=selected" : "")>深圳前海合作区人民法院</option>
                                    <option value="深圳市罗湖区人民法院" @(Model.Court == "深圳市罗湖区人民法院" ? "selected=selected" : "")>深圳市罗湖区人民法院</option>
                                    <option value="深圳市福田区人民法院" @(Model.Court == "深圳市福田区人民法院" ? "selected=selected" : "")>深圳市福田区人民法院</option>
                                    <option value="深圳市龙岗区人民法院" @(Model.Court == "深圳市龙岗区人民法院" ? "selected=selected" : "")>深圳市龙岗区人民法院</option>
                                    <option value="深圳市宝安区人民法院" @(Model.Court == "深圳市宝安区人民法院" ? "selected=selected" : "")>深圳市宝安区人民法院</option>
                                    <option value="深圳市南山区人民法院" @(Model.Court == "深圳市南山区人民法院" ? "selected=selected" : "")>深圳市南山区人民法院</option>
                                    <option value="惠州市大亚湾经济技术开发区人民法院" @(Model.Court == "惠州市大亚湾经济技术开发区人民法院" ? "selected=selected" : "")>惠州市大亚湾经济技术开发区人民法院</option>
                                    <option value="惠州市中级人民法院" @(Model.Court == "惠州市中级人民法院" ? "selected=selected" : "")>惠州市中级人民法院</option>
                                    <option value="惠州市龙门县人民法院" @(Model.Court == "惠州市龙门县人民法院" ? "selected=selected" : "")>惠州市龙门县人民法院</option>
                                    <option value="惠州市惠东县人民法院" @(Model.Court == "惠州市惠东县人民法院" ? "selected=selected" : "")>惠州市惠东县人民法院</option>
                                    <option value="惠州市惠阳区人民法院" @(Model.Court == "惠州市惠阳区人民法院" ? "selected=selected" : "")>惠州市惠阳区人民法院</option>
                                    <option value="惠州市惠城区人民法院" @(Model.Court == "惠州市惠城区人民法院" ? "selected=selected" : "")>惠州市惠城区人民法院</option>
                                    <option value="惠州市博罗县人民法院" @(Model.Court == "惠州市博罗县人民法院" ? "selected=selected" : "")>惠州市博罗县人民法院</option>
                                    <option value="惠州市仲恺区人民法院" @(Model.Court == "惠州市仲恺区人民法院" ? "selected=selected" : "")>惠州市仲恺区人民法院</option>
                                    <option value="中山市第一人民法院" @(Model.Court == "中山市第一人民法院" ? "selected=selected" : "")>中山市第一人民法院</option>
                                    <option value="中山市第二人民法院" @(Model.Court == "中山市第二人民法院" ? "selected=selected" : "")>中山市第二人民法院</option>
                                    <option value="中山市中级民法院" @(Model.Court == "中山市中级民法院" ? "selected=selected" : "")>中山市中级民法院</option>
                                    <option value="佛山市禅城区人民法院" @(Model.Court == "佛山市禅城区人民法院" ? "selected=selected" : "")>佛山市禅城区人民法院</option>
                                    <option value="佛山市南海区人民法院" @(Model.Court == "佛山市南海区人民法院" ? "selected=selected" : "")>佛山市南海区人民法院</option>
                                    <option value="佛山市高明区人民法院" @(Model.Court == "佛山市高明区人民法院" ? "selected=selected" : "")>佛山市高明区人民法院</option>
                                    <option value="佛山市中级人民法院" @(Model.Court == "佛山市中级人民法院" ? "selected=selected" : "")>佛山市中级人民法院</option>
                                    <option value="佛山市三水区人民法院" @(Model.Court == "佛山市三水区人民法院" ? "selected=selected" : "")>佛山市三水区人民法院</option>
                                    <option value="佛山市顺德区人民法院" @(Model.Court == "佛山市顺德区人民法院" ? "selected=selected" : "")>佛山市顺德区人民法院</option>
                                    <option value="江门市中级人民法院" @(Model.Court == "江门市中级人民法院" ? "selected=selected" : "")>江门市中级人民法院</option>
                                    <option value="江门市台山区人民法院" @(Model.Court == "江门市台山区人民法院" ? "selected=selected" : "")>江门市台山区人民法院</option>
                                    <option value="江门市江海区人民法院" @(Model.Court == "江门市江海区人民法院" ? "selected=selected" : "")>江门市江海区人民法院</option>
                                    <option value="江门市新会区人民法院" @(Model.Court == "江门市新会区人民法院" ? "selected=selected" : "")>江门市新会区人民法院</option>
                                    <option value="江门市蓬江区人民法院" @(Model.Court == "江门市蓬江区人民法院" ? "selected=selected" : "")>江门市蓬江区人民法院</option>
                                    <option value="珠海市香洲区人民法院" @(Model.Court == "珠海市香洲区人民法院" ? "selected=selected" : "")>珠海市香洲区人民法院</option>
                                    <option value="珠海市中级人民法院" @(Model.Court == "珠海市中级人民法院" ? "selected=selected" : "")>珠海市中级人民法院</option>
                                    <option value="珠海市横琴区人民法院" @(Model.Court == "珠海市横琴区人民法院" ? "selected=selected" : "")>珠海市横琴区人民法院</option>
                                    <option value="珠海市斗门区人民法院" @(Model.Court == "珠海市斗门区人民法院" ? "selected=selected" : "")>珠海市斗门区人民法院</option>
                                    <option value="珠海市金湾区人民法院" @(Model.Court == "珠海市金湾区人民法院" ? "selected=selected" : "")>珠海市金湾区人民法院</option>
                                    <option value="东莞市第一人民法院" @(Model.Court == "东莞市第一人民法院" ? "selected=selected" : "")>东莞市第一人民法院</option>
                                    <option value="东莞市第二人民法院" @(Model.Court == "东莞市第二人民法院" ? "selected=selected" : "")>东莞市第二人民法院</option>
                                    <option value="东莞市第三人民法院" @(Model.Court == "东莞市第三人民法院" ? "selected=selected" : "")>东莞市第三人民法院</option>
                                    <option value="东莞市中级人民法院" @(Model.Court == "东莞市中级人民法院" ? "selected=selected" : "")>东莞市中级人民法院</option>
                                    <option value="广东省陆河县人民法院" @(Model.Court == "广东省陆河县人民法院" ? "selected=selected" : "")>广东省陆河县人民法院</option>
                                    <option value="广东省博罗县人民法院" @(Model.Court == "广东省博罗县人民法院" ? "selected=selected" : "")>广东省博罗县人民法院</option>
                                    <option value="广东省佛冈县人民法院" @(Model.Court == "广东省佛冈县人民法院" ? "selected=selected" : "")>广东省佛冈县人民法院</option>
                                    <option value="广东省高级人民法院" @(Model.Court == "广东省高级人民法院" ? "selected=selected" : "")>广东省高级人民法院</option>
                                    <option value="广东省鹤山市人民法院" @(Model.Court == "广东省鹤山市人民法院" ? "selected=selected" : "")>广东省鹤山市人民法院</option>
                                    <option value="韶关市武江区人民法院" @(Model.Court == "韶关市武江区人民法院" ? "selected=selected" : "")>韶关市武江区人民法院</option>
                                    <option value="韶关市曲江区人民法院" @(Model.Court == "韶关市曲江区人民法院" ? "selected=selected" : "")>韶关市曲江区人民法院</option>
                                    <option value="清远市清新区人民法院" @(Model.Court == "清远市清新区人民法院" ? "selected=selected" : "")>清远市清新区人民法院</option>
                                    <option value="北京市大兴区人民法院" @(Model.Court == "北京市大兴区人民法院" ? "selected=selected" : "")>北京市大兴区人民法院</option>
                                    <option value="潮州市潮安区人民法院" @(Model.Court == "潮州市潮安区人民法院" ? "selected=selected" : "")>潮州市潮安区人民法院</option>
                                    <option value="潮州市湘桥区人民法院" @(Model.Court == "潮州市湘桥区人民法院" ? "selected=selected" : "")>潮州市湘桥区人民法院</option>
                                    <option value="丰顺县人民法院" @(Model.Court == "丰顺县人民法院" ? "selected=selected" : "")>丰顺县人民法院</option>
                                    <option value="恩平市人民法院" @(Model.Court == "恩平市人民法院" ? "selected=selected" : "")>恩平市人民法院</option>
                                    <option value="揭阳市惠来县人民法院" @(Model.Court == "揭阳市惠来县人民法院" ? "selected=selected" : "")>揭阳市惠来县人民法院</option>
                                    <option value="揭阳市榕城区人民法院" @(Model.Court == "揭阳市榕城区人民法院" ? "selected=selected" : "")>揭阳市榕城区人民法院</option>
                                    <option value="汕头市澄海区人民法院" @(Model.Court == "汕头市澄海区人民法院" ? "selected=selected" : "")>汕头市澄海区人民法院</option>
                                    <option value="上海市宝山区人民法院" @(Model.Court == "上海市宝山区人民法院" ? "selected=selected" : "")>上海市宝山区人民法院</option>
                                    <option value="汕头市朝阳区人民法院" @(Model.Court == "汕头市朝阳区人民法院" ? "selected=selected" : "")>汕头市朝阳区人民法院</option>
                                    <option value="梅州市梅江区人民法院" @(Model.Court == "梅州市梅江区人民法院" ? "selected=selected" : "")>梅州市梅江区人民法院</option>
                                    <option value="广东省乐昌市人民法院" @(Model.Court == "广东省乐昌市人民法院" ? "selected=selected" : "")>广东省乐昌市人民法院</option>
                                    <option value="广东省开平市人民法院" @(Model.Court == "广东省开平市人民法院" ? "selected=selected" : "")>广东省开平市人民法院</option>
                                    <option value="河南省邓州市人民法院" @(Model.Court == "河南省邓州市人民法院" ? "selected=selected" : "")>河南省邓州市人民法院</option>
                                    <option value="广州市增城区人民法院" @(Model.Court == "广州市增城区人民法院" ? "selected=selected" : "")>广州市增城区人民法院</option>
                                    <option value="河源市源城区人民法院" @(Model.Court == "河源市源城区人民法院" ? "selected=selected" : "")>河源市源城区人民法院</option>
                                  </select>

                            }
                        </td>
                    </tr>
                    <tr>
                        <td class="text_w" align="center">标的金额 <a style="color:red;position:relative; top:3px">*</a></td>
                        <td>
                            @if (IsViewMode)
                            {
                                  @Html.formatCash(Model.Amount.HasValue ? Model.Amount.Value.ToString() : "0.00")
                            }
                            else
                            {
                                <input type="text" id="Amount" name="Amount" class="validate[required] validate[custom[number]] in_c1" onchange="CalRate()" style="width:98%" value="@Model.Amount" onblur="applyUserChange()" />
                            }
                        </td>
                        <td class="text_w" align="center">是否开发票 <a style="color:red;position:relative; top:3px">*</a></td>
                        <td>
                            @if (IsViewMode)
                            {
                                @(Model.InvoiceType == 0 ? "否" : (Model.InvoiceType == 1 ? "是，应付佣金算税费" : "是，合同收款算税费"))
                            }
                            else
                            {
                                <select id="InvoiceType" name="InvoiceType" class="validate[required] in_c1" style="width:66px" onchange="CalRate()">
                                    <option value="0">否</option>
                                    <option value="1">是，应付佣金算税费 </option>
                                    <option value="2">是，合同收款算税费</option>
                                </select>
                            }
                        </td>
                        <td class="text_w" align="center">合同收款 <a style="color:red;position:relative; top:3px">*</a></td>
                        <td>
                            @if (IsViewMode)
                            {
                                 @Html.formatCash(Model.ContractAmount.HasValue ? Model.ContractAmount.Value.ToString() : "0.00")
                            }
                            else
                            {
                                <input type="text" id="ContractAmount" name="ContractAmount" onchange="CalRate()" class="validate[required] in_c1 " style="width:98%" value="@Model.ContractAmount" />
                            }
                        </td>
                    </tr>

                    <tr>
                        <td class="text_w" align="center">费率 <a style="color:red;position:relative; top:3px">*</a></td>
                        <td>
                            @if (IsViewMode)
                            {
                                @Model.Rate
                            }
                            else
                            {
                                <input type="text" id="Rate" name="Rate" onchange="CalRate1()" class="validate[required] in_c1 " style="width:85%" value="@Model.Rate" />
                            }
                            %
                        </td>
                        <td class="text_w" align="center">实际收费 <a style="color:red;position:relative; top:3px">*</a></td>
                        <td>
                            @if (IsViewMode)
                            {
                                @Html.formatCash(Model.ActualCharge.HasValue ? Model.ActualCharge.Value.ToString() : "0.00")
                            }
                            else
                            {
                                <input type="text" id="ActualCharge" name="ActualCharge" onchange="CalRate()" class="validate[required] in_c1 " style="width:98%" value="@Model.ActualCharge" />
                            }
                        </td>
                        <td class="text_w" align="center">实际费率 <a style="color:red;position:relative; top:3px">*</a></td>
                        <td>
                            @if (IsViewMode)
                            {
                                @Model.ActualRate
                            }
                            else
                            {
                                <input type="text" id="ActualRate" name="ActualRate" onchange="CalRate12()"  class="validate[required] in_c1 " style="width:85%" value="@Model.ActualRate" />
                            }
                            %
                        </td>
                    </tr>
                    <tr>
                        <td class="text_w" align="center">应付佣金 <a style="color:red;position:relative; top:3px">*</a></td>
                        <td>
                            @if (IsViewMode)
                            {
                                 @Html.formatCash(Model.PayableAmount.HasValue ? Model.PayableAmount.Value.ToString() : "0.00")
                            }
                            else
                            {
                                <input type="text" id="PayableAmount" name="PayableAmount" readonly="readonly" onchange="CalRate()" class="validate[required] in_c1 " style="width:98%" value="@Model.PayableAmount" />
                            }
                        </td>
                        <td class="text_w" align="center">实付中介费</td>
                        <td colspan="1">
                            @if (IsViewMode)
                            {
                                 @Html.formatCash(Model.PaidAmount.HasValue ? Model.PaidAmount.Value.ToString() : "0.00")
                            }
                            else
                            {
                                <input type="text" id="PaidAmount" name="PaidAmount" readonly="readonly" class="validate[required] in_c1 " style="width:98%" value="@Model.PaidAmount" />
                            }
                        </td>
                        <td class="text_w" align="center">联保情况 <a style="color:red;position:relative; top:3px">*</a></td>
                        <td colspan="1">
                            @if (IsViewMode)
                            {
                                @Model.GuaranteeSituation
                            }
                            else
                            {
                                <input type="text" id="GuaranteeSituation" name="GuaranteeSituation" class="validate[required] in_c1 " style="width:98%" value="@Model.GuaranteeSituation" />
                            }
                        </td>
                    </tr>
                    <tr id="showStatus" @if (IsViewMode) { @(Model.InvoiceType == 0 ? "style=display:none" : "") }>
                        <td class="text_w" align="center">应扣税费</td>
                        <td colspan="5">
                            @if (IsViewMode)
                            {
                                  @Html.formatCash(Model.Taxation.Value.ToString())
                            }
                            else
                            {
                                <input type="text" id="Taxation" name="Taxation" readonly="readonly" class="validate[required] in_c1 " style="width:98%" value="@Model.Taxation" />
                            }
                        </td>

                    </tr>
                    <tr>
                        <td class="text_w" align="center">保函类型 <a style="color:red;position:relative; top:3px">*</a></td>
                        <td colspan="5">
                            @if (IsViewMode)
                            {
                                @(Model.GuaranteeType)
                            }
                            else
                            {
                                <select id="GuaranteeType" name="GuaranteeType" class="validate[required] in_c1" style="width:100px">
                                    <option value="一般案件" @(Model.GuaranteeType == "一般案件" ? "selected=selected" : "")>一般案件</option>
                                    <option value="联保案件" @(Model.GuaranteeType == "联保案件" ? "selected=selected" : "")>联保案件</option>
                                    <option value="保险案件" @(Model.GuaranteeType == "保险案件" ? "selected=selected" : "")>保险案件</option>
                                </select>
                            }
                        </td>
                    </tr>
                    <tr>
                        <td class="text_w" align="center">申请人身份证或法定代表人<a style="color:red;position:relative; top:3px">*</a></td>
                        <td colspan="5">
                            @if (IsViewMode)
                            {
                                @Model.ApplyIDCard
                            }
                            else
                            {
                                <input type="text" id="ApplyIDCard" name="ApplyIDCard" placeholder="多个申请人用、相隔  例如 张三、李四 " class="validate[required] in_c1 " style="width:98%" value="@Model.ApplyIDCard" />
                            }
                        </td>

                    </tr>
                    <tr>
                        <td class="text_w" align="center">申请人地址 <a style="color:red;position:relative; top:3px">*</a></td>
                        <td colspan="5">
                            @if (IsViewMode)
                            {
                                @Model.ApplyAddress
                            }
                            else
                            {
                                <input type="text" id="ApplyAddress" name="ApplyAddress" placeholder="多个地址用、相隔  例如 广西省A市、广东省B市 " class="validate[required] in_c1 " style="width:98%" value="@Model.ApplyAddress" />
                            }
                        </td>
                    </tr>
                    <tr>
                        <td class="text_w" align="center">申请人担保情况<a style="color:red;position:relative; top:3px">*</a></td>
                        <td colspan="2">
                            @if (IsViewMode)
                            {
                                @Model.ApplyGuarantee
                            }
                            else
                            {
                                <input type="text" id="ApplyGuarantee" placeholder="统一格式：申请人诉被申请人XX纠纷一案" name="ApplyGuarantee" class="validate[required] in_c1 " style="width:98%" value="@Model.ApplyGuarantee" />
                            }
                        </td>
                        <td class="text_w" align="center">保证金 <a style="color:red;position:relative; top:3px">*</a></td>
                        <td colspan="2">
                            @if (IsViewMode)
                            {
                                @Html.formatCash(Model.Bond.HasValue?Model.Bond.Value.ToString():"0.00")
                            }
                            else
                            {
                                <input type="text" id="Bond" name="Bond" class="validate[required] in_c1 " style="width:98%" value="@Model.Bond" />
                            }
                        </td>

                    </tr>
                    @if (!IsViewMode || (IsViewMode && Model.GuaranteeType == "联保案件"))
                    {
                        <tr class="showLB" style="display:none">
                            <td rowspan="4" class="text_w" align="center">联保公司信息</td>
                            <td colspan="1" class="text_w" align="center">乙方</td>
                            <td colspan="4">
                                @if (IsViewMode)
                                {
                                    @Model.CompanyGuarantee

                                }
                                else
                                {
                                    <input type="text" class=" in_c1 " id="CompanyGuarantee" name="CompanyGuarantee" value="@Model.CompanyGuarantee" />
                                }
                            </td>
                        </tr>
                        <tr class="showLB" style="display:none">
                            <td class="text_w" align="center">法定代表人</td>
                            <td colspan="4">
                                @if (IsViewMode)
                                {
                                    @Model.CompanyUser
                                }
                                else
                                {
                                    <input type="text" class="in_c1 " id="CompanyUser" name="CompanyUser" value="@Model.CompanyUser" />
                                }
                            </td>
                        </tr>
                        <tr class="showLB" style="display:none">
                            <td class="text_w" align="center">地址 </td>
                            <td colspan="4">
                                @if (IsViewMode)
                                {
                                    @Model.CompanyAddress
                                }
                                else
                                {
                                    <input type="text" class="in_c1 " id="CompanyAddress" name="CompanyAddress" value="@Model.CompanyAddress" />
                                }
                            </td>
                        </tr>
                        <tr class="showLB" style="display:none">
                            <td class="text_w" align="center">联系电话</td>
                            <td colspan="4">
                                @if (IsViewMode)
                                {
                                    @Model.CompanyTel
                                }
                                else
                                {
                                    <input type="text" class="in_c1 " id="CompanyTel" name="CompanyTel" value="@Model.CompanyTel" />
                                }
                            </td>
                        </tr>
                    }
                    @if (!IsViewMode || (IsViewMode && Model.GuaranteeType == "保险案件"))
                    {
                        <tr class="showBX" style="display:none">
                            <td class="text_w" align="center">保险公司名称：</td>
                            <td colspan="5">
                                @if (IsViewMode)
                                {
                                    @Model.InsuranceCooperation
                                }
                                else
                                {
                                    <input type="text" id="InsuranceCooperation" name="InsuranceCooperation" style="width:220px" class="in_c1" value="@Model.InsuranceCooperation" />
                                }
                            </td>
                        </tr>
                    }
                    @if (!IsViewMode || (IsViewMode && Model.GuaranteeType == "联保案件") || (IsViewMode && Model.GuaranteeType == "保险案件"))
                {
                    <tr class="showLBBX">
                        <td class="text_w" align="center" id="tdgongs"> @(Model.GuaranteeType == "联保案件" ? " 合作的联保公司名称" : "合作的保险公司名称")</td>
                        <td colspan="2">
                            @if (IsViewMode)
                            {
                                @Model.LBgongsi
                            }
                            else
                            {
                                <input type="text" id="LBgongsi" name="LBgongsi" class="in_c1 " style="width:98%" value="@Model.LBgongsi" />
                            }
                        </td>
                        <td class="text_w" align="center">总标的金额(元):</td>
                        <td colspan="2">
                            @if (IsViewMode)
                            {
                                @Html.formatCash(Model.ZBjine.HasValue ? Model.ZBjine.Value.ToString() : "0.00")
                            }
                            else
                            {
                                <input type="text" id="ZBjine" name="ZBjine" class=" in_c1 " style="width:98%" value="@Model.ZBjine" />
                            }
                        </td>
                    </tr>
                        <tr class="showLBBX">
                            <td class="text_w" align="center">富昌担保标的(元):</td>
                            <td colspan="2">
                                @if (IsViewMode)
                                {
                                    @Html.formatCash(Model.DBjine.HasValue ? Model.DBjine.Value.ToString() : "0.00")
                                }
                                else
                                {
                                    <input type="text" id="DBjine" name="DBjine" class="in_c1 " style="width:98%" value="@Model.DBjine" />
                                }
                            </td>
                            <td class="text_w" align="center">占总标的比例:</td>
                            <td colspan="2">
                                @if (IsViewMode)
                                {
                                    @Html.formatCash(Model.ZBbili.HasValue ? Model.ZBbili.Value.ToString() : "0.00")
                                }
                                else
                                {
                                    <input type="text" id="ZBbili" name="ZBbili" class=" in_c1 " style="width:90%" value="@Model.ZBbili" />
                                }%
                            </td>

                        </tr>
                      <tr class="showLBBX">
                            <td class="text_w" align="center">富昌协议费用(元)</td>
                            <td colspan="2">
                                @if (IsViewMode)
                            {
                                    @Html.formatCash(Model.XYfeiyong.HasValue ? Model.XYfeiyong.Value.ToString() : "0.00")
                            }
                                else
                                {
                                    <input type="text" id="XYfeiyong" name="XYfeiyong" class="in_c1 " style="width:98%" value="@Model.XYfeiyong" />
                                }
                            </td>
                            <td class="text_w" align="center">富昌实收费用(元):</td>
                            <td colspan="2">
                                @if (IsViewMode)
                            {
                                    @Html.formatCash(Model.FCSSfeiyong.HasValue ? Model.FCSSfeiyong.Value.ToString() : "0.00")
                            }
                                else
                                {
                                    <input type="text" id="FCSSfeiyong" name="FCSSfeiyong" class=" in_c1 " style="width:98%" value="@Model.FCSSfeiyong" />
                                }
                            </td>

                        </tr>
                          <tr class="showLBBX">
                             <td class="text_w" align="center">他司担保标的(元):</td>
                            <td colspan="2">
                                @if (IsViewMode)
                            {
                                      @Html.formatCash(Model.TSDBjine.HasValue ? Model.TSDBjine.Value.ToString() : "0.00")
          
                            }
                                else
                                {
                                    <input type="text" id="TSDBjine" name="TSDBjine" class="in_c1 " style="width:98%" value="@Model.TSDBjine" />
                                }
                            </td>
                            <td class="text_w" align="center">占总标的比例:</td>
                            <td colspan="2">
                                @if (IsViewMode)
                            {
                                    @Html.formatCash(Model.FCZbili.HasValue ? Model.FCZbili.Value.ToString() : "0.00")
                            }
                                else
                                {
                                    <input type="text" id="FCZbili" name="FCZbili" class=" in_c1 " style="width:90%" value="@Model.FCZbili" />
                                }%
                            </td>

                        </tr>
                          <tr class="showLBBX">
                            <td class="text_w" align="center">他司协议费用(元):</td>
                            <td colspan="2">
                                @if (IsViewMode)
                            {
                                       @Html.formatCash(Model.TSXYfeiyong.HasValue ? Model.TSXYfeiyong.Value.ToString() : "0.00")
                            }
                                else
                                {
                                    <input type="text" id="TSXYfeiyong" name="TSXYfeiyong" class="in_c1 " style="width:98%" value="@Model.TSXYfeiyong" />
                                }
                            </td>
                            <td class="text_w" align="center">他司实收费用(元):</td>
                            <td colspan="2">
                                @if (IsViewMode)
                            {
                                    @Html.formatCash(Model.TSSHfeiyong.HasValue ? Model.TSSHfeiyong.Value.ToString() : "0.00")
                            }
                                else
                                {
                                    <input type="text" id="TSSHfeiyong" name="TSSHfeiyong" class=" in_c1 " style="width:98%" value="@Model.TSSHfeiyong" />
                                }
                            </td>

                        </tr>
                          <tr class="showLBBX">
                            <td class="text_w" align="center">返佣费用(元):</td>
                            <td colspan="2">
                                @if (IsViewMode)
                            {
                                  @Html.formatCash(Model.FYfeiyong.HasValue ? Model.FYfeiyong.Value.ToString() : "0.00")
                            }
                                else
                                {
                                    <input type="text" id="FYfeiyong" name="FYfeiyong" class="in_c1 " style="width:98%" value="@Model.FYfeiyong" />
                                }
                            </td>
                            <td class="text_w" align="center">收据/发票:</td>
                            <td colspan="2">
                                @if (IsViewMode)
                            {
                                    @Model.shouju
                            }
                                else
                                {
                                    <input type="text" id="shouju" name="shouju" class=" in_c1 " style="width:98%" value="@Model.shouju" />
                                }
                            </td>

                        </tr>
                          <tr class="showLBBX">
                            <td class="text_w" align="center">是否需要保证金:</td>
                            <td >
                                @if (IsViewMode)
                            {
                                    @Model.JLbaozhengjin
                            }
                                else
                                {
                                    <input type="text" id="JLbaozhengjin" name="JLbaozhengjin" class="in_c1 " style="width:98%" value="@Model.JLbaozhengjin" />
                                }
                            </td>
                            <td class="text_w" align="center">金额(元):</td>
                            <td >
                                @if (IsViewMode)
                            {
                                    @Html.formatCash(Model.BZJjine.HasValue ? Model.Bond.Value.ToString() : "0.00")
                            }
                                else
                                {
                                    <input type="text" id="BZJjine" name="BZJjine" class=" in_c1 " style="width:98%" value="@Model.BZJjine" />
                                }
                            </td>
                             <td class="text_w" align="center">税费(元):</td>
                             <td>
                                 @if (IsViewMode)
                                 {
                                     @Html.formatCash(Model.suifei.HasValue ? Model.suifei.Value.ToString() : "0.00")
                                 }
                                 else
                                 {
                                    <input type="text" id="suifei" name="suifei" class=" in_c1 " style="width:98%" value="@Model.suifei" />
                                 }
                             </td>
                        </tr>
                    }
                    <tr>
                        <td class="text_w" align="center">财产线索：</td>
                        <td colspan="5">
                            @if (IsViewMode)
                            {
                                @Model.PropertyClues
                            }
                            else
                            {
                                <input type="text" id="PropertyClues" name="PropertyClues" style="width:95%" class="in_c1" value="@Model.PropertyClues" />
                            }
                        </td>
                    </tr>
                    <tr>
                        <td class="text_w" align="center">业务备注：</td>
                        <td colspan="5">
                            @if (IsViewMode)
                            {
                                @Model.BusinessRemark
                            }
                            else
                            {
                                <input type="text" id="BusinessRemark" name="BusinessRemark" style="width:95%" class="in_c1" value="@Model.BusinessRemark" />
                            }
                        </td>
                    </tr>

                </table>
            }

            @* 出纳确认收款输入*@
            <form style="display:none" action="@Url.Action("SaveFormCDBFinance", "Form")" id="frmOTInfoConfirm">
                <input type="hidden" name="ProcessGuid" value='@Request["ProcessGuid"]' />
                <input type="hidden" name="ID" value="@Model.ID" />
                <input type="hidden" name="FormGuid" value="@Model.FormGuid" />
                <input type="hidden" name="Status" value="@Model.Status" />
                <table style="width:100%;height:36px; border:none;">
                    <tr>
                        <td rowspan="3" class="text_w" align="center">04.出纳确认收款信息</td>
                        <td class="text_w" align="center">财务实收金额</td>
                        <td colspan="2">
                            <input type="text" id="financiaAmount" name="financiaAmount" class=" validate[custom[number]] in_c1" style="width:98%" value="@Model.financiaAmount" />
                        </td>
                        <td class="text_w" align="center">收费日期</td>
                        <td colspan="2">
                            <input type="text" id="ChargingDate" name="ChargingDate" class="in_c1 " style="width:98%" value="@Model.ChargingDate" />

                        </td>
                    </tr>
                    @if (Model.InvoiceType == null || Model.InvoiceType == 0)
                    {
                        <tr>
                            <td class="text_w" align="center">收据开具情况</td>
                            <td colspan="2">
                                <select id="ReceiptInfo" name="ReceiptInfo" class="in_c1" style="width:90%   ">
                                    <option @(Model.ReceiptInfo == "" ? "selected" : "") value=""></option>
                                    <option @(Model.ReceiptInfo == "未开收据" ? "selected" : "") value="未开收据">未开收据</option>
                                    <option @(Model.ReceiptInfo == "收据已开，款已收" ? "selected" : "") value="收据已开，款已收">收据已开，款已收</option>
                                    <option @(Model.ReceiptInfo == "收据已开，款未收" ? "selected" : "") value="收据已开，款未收">收据已开，款未收</option>
                                </select>

                            </td>

                        </tr>
                    }
                    <tr>
                        <td class="text_w" align="center">出纳备注</td>
                        <td colspan="5">

                            <input type="text" id="FinanceRemark" name="FinanceRemark" class=" in_c1 " style="width:98%" value="@Model.FinanceRemark" />
                        </td>

                    </tr>


                </table>
            </form>

            @* 会计确认输入*@
            <form style="display:none" action="@Url.Action("SaveFormCDBAccount", "Form")" id="frmAccount">
                <input type="hidden" name="ProcessGuid" value='@Request["ProcessGuid"]' />
                <input type="hidden" name="ID" value="@Model.ID" />
                <input type="hidden" name="FormGuid" value="@Model.FormGuid" />
                <input type="hidden" name="Status" value="@Model.Status" />
                <table style="width:100%;height:36px; border:none;">
                    <tr>
                        <td rowspan="2" class="text_w" align="center">07.会计确认返佣</td>

                        <td class="text_w" align="center">实付中介费</td>
                        <td colspan="2">

                            <input type="text" id="Intermediary" name="Intermediary" class="validate[custom[number]]  in_c1 " style="width:98%" value="@Model.Intermediary" />
                        </td>
                        <td class="text_w" align="center">实际返佣时</td>
                        <td colspan="2">

                            <input type="text" id="RebateTime" name="RebateTime" class=" in_c1" style="width:98%" value="@Model.RebateTime" />
                        </td>
                    </tr>
                    <tr>
                        <td class="text_w" align="center">会计备注</td>
                        <td colspan="5">

                            <input type="text" id="AccountRemark" name="AccountRemark" class=" in_c1 " style="width:98%" value="@Model.AccountRemark" />
                        </td>

                    </tr>


                </table>
            </form>


            @* 总裁办第三部输入*@
            <form style="display:none" action="@Url.Action("SaveFormCDBBeforePresident", "Form")" id="frmBeforePresident">
                <input type="hidden" name="ProcessGuid" value='@Request["ProcessGuid"]' />
                <input type="hidden" name="ID" value="@Model.ID" />
                <input type="hidden" name="FormGuid" value="@Model.FormGuid" />
                <input type="hidden" name="Status" value="@Model.Status" />
                <table style="width:100%;height:30px; border:none;">
                    <tr>
                        <td rowspan="3" class="text_w" align="center">03.总裁办确认</td>
                        <td class="text_w" align="center">是否确认盖章</td>
                        <td class="text_w" colspan="1">
                            <select id="SealStatus" name="SealStatus" class="validate[required] in_c1" style="width:150px">
                                <option value="" @((Model.SealStatus.IsEmpty()) ? "selected=selected" : "")></option>
                                <option value="现场已盖章" @(("现场已盖章").Equals(Model.SealStatus) ? "selected=selected" : "")>现场已盖章</option>
                                <option value="仅盖协议/保函" @(  ("仅盖协议/保函").Equals(Model.SealStatus) ? "selected=selected" : "")>仅盖协议/保函</option>
                                <option value="异地单确认收费标准" @( ("异地单确认收费标准").Equals(Model.SealStatus) ? "selected=selected" : "")>异地单确认收费标准</option>
                            </select>
                     
                        <td class="text_w" colspan="1">
                            同意
                            <input id="txtCheckState" checked="checked" type="radio" name="CheckState" value="1">不同意
                            <input id="txtCheckState" type="radio" name="CheckState" value="2">
                        </td>
                    <tr>
                        <td class="text_w" colspan="3">
                            <input type="text" id="txtCheckContent" name="CheckContent" class=" in_c1 " style="width:98%" value="@Model.Judge" />
                        </td>
                    </tr>

                </table>
            </form>



            @* 总裁办输入*@
            <form style="display:none" action="@Url.Action("SaveFormCDBPresident", "Form")" id="frmPresident">
                <input type="hidden" name="ProcessGuid" value='@Request["ProcessGuid"]' />
                <input type="hidden" name="ID" value="@Model.ID" />
                <input type="hidden" name="FormGuid" value="@Model.FormGuid" />
                <input type="hidden" name="Status" value="@Model.Status" />
                <table style="width:100%;height:30px; border:none;">
                    <tr>
                        <td rowspan="5" class="text_w" align="center">11. 确认归档</td>
                        <td class="text_w" align="center">是否归档</td>
                        <td colspan="1">

                            <select id="IsGetFile" name="IsGetFile" class=" in_c1" style="width:66px">
                                <option value="true" @(Model.IsGetFile == null || Model.IsGetFile.Value ? "selected=selected" : "")>是</option>
                                <option value="false" @(Model.IsGetFile == null || Model.IsGetFile.Value ? "" : "selected=selected")>否</option>
                            </select>
                        </td>
                        <td class="text_w" align="center">是否已收费</td>
                        <td colspan="1">
                            <select id="IsCharge" name="IsCharge" class=" in_c1" style="width:66px">
                                <option value="true" @(Model.IsCharge == null || Model.IsCharge.Value ? "selected=selected" : "")>是</option>
                                <option value="false" @(Model.IsCharge == null || Model.IsCharge.Value ? "" : "selected=selected")>否</option>
                            </select>
                        </td>
   
                     
            
                    </tr>

                </table>
            </form>
            @* 综合室输入*@
            <form style="display:none" action="@Url.Action("SaveFormCDBComprehensive", "Form")" id="frmComprehensive">
                <input type="hidden" name="ProcessGuid" value='@Request["ProcessGuid"]' />
                <input type="hidden" name="ID" value="@Model.ID" />
                <input type="hidden" name="FormGuid" value="@Model.FormGuid" />
                <input type="hidden" name="Status" value="@Model.Status" />
                <table style="width:100%;height:36px; border:none;">

                    <tr>
                        <td rowspan="5" class="text_w" align="center">12.综合室审核</td>
                        <td class="text_w" align="center">主审法官</td>
                        <td colspan="1">

                            <input type="text" id="Judge" name="Judge" class=" in_c1 " style="width:98%" value="@Model.Judge" />

                        </td>
                        <td class="text_w" align="center">业绩归属年月</td>
                        <td colspan="1">

                            <input type="text" id="AchievementTime" name="AchievementTime" class="in_c1 " style="width:98%" value="@Model.AchievementTime" />

                        </td>
                    </tr>
                    <tr>
                        <td class="text_w" align="center">案件状态</td>
                        <td colspan="1">

                            <input type="text" id="CaseStatus" name="CaseStatus" class=" in_c1 " style="width:98%" value="@Model.CaseStatus" />

                        </td>
                        <td class="text_w" align="center">龙岗数据报送</td>
                        <td colspan="1">

                            <input type="text" id="DataSend" name="DataSend" class=" in_c1 " style="width:98%" value="@Model.DataSend" />

                        </td>
                    </tr>
                    <tr>
                        <td class="text_w" align="center">提成是否发放</td>
                        <td colspan="1">
                            <select id="CommissionSend" name="CommissionSend" class="validate[required] in_c1" style="width:66px">
                                <option value="true"    @(Model.CommissionSend == null || Model.CommissionSend.Value ? "selected=selected" : "")>是</option>
                                <option value="false" @(Model.CommissionSend == null || Model.CommissionSend.Value ? "" : "selected=selected")>否</option>
                            </select>

                        </td>
                        <td class="text_w" align="center">释放额度情况</td>
                        <td colspan="1">

                            <input type="text" id="Quota" name="Quota" class=" in_c1 " style="width:98%" value="@Model.Quota" />

                        </td>

                    </tr>
                    <tr>
                        <td class="text_w" align="center">提成金额</td>
                        <td class="text_w"> <input type="text" id="CommissionApr" name="CommissionApr" class="validate[required] validate[custom[number]] in_c1 " style="width:50%" value="@Model.CommissionApr" /></td>
                        <td class="text_w" align="center">综合部备注 <a style="color:red;position:relative; top:3px">*</a></td>
                        <td colspan="1">
                            <input type="text" id="GeneralRemark" name="GeneralRemark" class=" in_c1 " style="width:98%" value="@Model.GeneralRemark" />
                        </td>
                    </tr>
                   
                    @if (User.HasFlag(FB.Security.FCDB.ProcessInstance.ComprehensiveManager.View))
                    {
                    <tr>
                        <td class="text_w" align="center">负责人</td>
                        <td colspan="1">
                                <input type="text" disabled="disabled" style="width: 70px" id="HeadName" class="in_c1" value="@ViewBag.HeadName" name="HeadName" />
                                <input id="HeadID" type="hidden" name="HeadID" value="@Model.HeadID" />
                                <a href="javascript:void(0)" class="btn_c3 " onclick="addHeadUsers()">添加</a>
                        </td>
                        <td class="text_w" align="center">负责人提成比例</td>
                        <td colspan="1">
                                <input type="text" class="in_c1" style="width:70px" id="HeadApr" name="HeadApr" value="@Model.HeadApr" />%
                        </td>
                    </tr>

                    <tr>
                        <td class="text_w" align="center">A角</td>
                        <td colspan="1">
                                <input type="text" class="in_c1" style="width: 70px" disabled="disabled" id="AName" name="AName" value="@ViewBag.AName" placeholder="没有就不填" />
                                <input id="RoleAID" type="hidden" name="RoleAID" value="@Model.RoleAID" />
                                <a href="javascript:void(0)" class="btn_c3 " onclick="addAUsers()">添加</a>
                        </td>
                        <td class="text_w" align="center">A角提成比例</td>
                        <td colspan="1">
                                <input type="text" class="in_c1" style="width:70px" id="RoleAApr" name="RoleAApr" placeholder="没有就不填" value="@Model.RoleAApr" />%
                        </td>
                    </tr>

                    <tr>
                        <td class="text_w" align="center">B角提成比例</td>
                        <td colspan="1">
                                <input type="text" class="in_c1" style="width:70px" id="RoleBApr" name="RoleBApr" placeholder="没有就不填" value="@Model.RoleBApr" />%
                        </td>

                        <td class="text_w" align="center">B角</td>
                        <td colspan="1">
                                <input type="text" class="in_c1" style="width:70px" id="BName" readonly="readonly" name="BName" value="@ViewBag.BName" placeholder="没有就不填" />
                                <input id="RoleBID" type="hidden" name="RoleBID" value="@Model.RoleBID" />
                                <a href="javascript:void(0)" class="btn_c3 " onclick="addBUsers()">添加</a>
                          </td>
                    </tr>
                    }
                </table> 
            </form>  
              @* 业务填写返佣*@
            <form style="display:none" action="@Url.Action("SaveFormCDBBackAmount", "Form")" id="frmbackAmount">
                <input type="hidden" name="ProcessGuid" value='@Request["ProcessGuid"]' />
                <input type="hidden" name="ID" value="@Model.ID" />
                <input type="hidden" name="FormGuid" value="@Model.FormGuid" />
                <input type="hidden" name="Status" value="@Model.Status" />
                <table style="width:100%;height:30px; border:none;">
                    <tr>
                        <td rowspan="6" class="text_w" align="center" style="width:129px">05.业务员填写返佣信息</td>
                        <td colspan="1" class="text_w" align="center">公司名称</td>
                        <td colspan="1">

                            <input type="text" class=" in_c1 " style="width:95%" id="CompanyName" name="CompanyName" value="@Model.CompanyName" />

                        </td>
                    </tr>
                    <tr>
                        <td class="text_w" align="center">开户银行</td>
                        <td colspan="1">
                            <input type="text" class="in_c1 " id="Bank" name="Bank" style="width:95%" value="@Model.Bank" />

                        </td>
                    </tr>
                    <tr>
                        <td class="text_w" align="center">账号 </td>
                        <td colspan="1">
                            <input type="text" class="in_c1 " id="AccountNo" name="AccountNo" style="width:95%" value="@Model.AccountNo" />

                        </td>
                    </tr>

                    <tr>

                        <td colspan="1" class="text_w" align="center">申请金额</td>
                        <td colspan="1">
                            <input type="text" class="validate[custom[number]] in_c1" style="width:95%" onchange=upLowWord() id="Due" name="Due" value="@Model.Due" />

                        </td>
                    </tr>

                    <tr class="printArea_disable">
                        <td class="text_w" align="center">归属公司 <a style="color:red;position:relative; top:3px">*</a></td>
                        <td colspan="1">
                            <input type="text" class="validate[required] in_c1 " style="width:95%" id="PayCompany" name="PayCompany" value="@(Model.PayCompany.IsEmpty() ? "深圳市汇盈咨询服务有限公司" : Model.PayCompany)" />

                        </td>
                    </tr>

                    <tr class="printArea_disable">
                        <td class="text_w" align="center">备注 </td>
                        <td colspan="1">
                            <input type="text" class="in_c1 " style="width:95%" id="Remark" name="Remark" value="@Model.Remark" />
                        </td>
                    </tr>
                </table>
            </form>
            @{
                Html.RenderPartial("UCFormCheckLog");
            }
        </div>
    </div>
    <div class="from_r">
        <div class="right_con_f">
            <div class="f_fj">
                @{
                    Html.RenderPartial("UCFormAttachment", (IList<FCDB.Entity.FormAttachment>)ViewBag.FormAttachments);
                }
            </div>
            <div class="f_fj">
                @{
                    Html.RenderPartial("UCFormsRelation", (IList<FCDB.Entity.FormsRelation>)ViewBag.FormsRelations);
                }

            </div>
            <div class="xx_yj">
                <p class="yj_tit">详细意见</p>
                <div class="con_yj">
                    @{
                        Html.RenderPartial("UCFormCirculatedDocumentLog", (IList<FCDB.Entity.FormCirculatedDocumentLog>)ViewBag.FormCirculatedDocumentLogs);
                    }
                </div>
            </div>

        </div>
    </div>
</div>

<script src=@Url.Content("/Scripts/jquery.form.js") type="text/javascript"></script>
<script src=@Url.Content("/Scripts/FCDB.form.js?v=20170821") type="text/javascript"></script>
<script type="text/javascript">
    $(function () {
        $("#frm").validationEngine({ promptPosition: "topLeft" });
        $("#frmbackAmount").validationEngine({ promptPosition: "topLeft" });
        $("#frmComprehensive").validationEngine({ promptPosition: "topLeft" });
        $("#frmAccount").validationEngine({ promptPosition: "topLeft" });
        $("#frmOTInfoConfirm").validationEngine({ promptPosition: "topLeft" });
        $("#FormDate").kendoDatePicker({
            format: "yyyy-MM-dd",
            value: new Date()
        });
        $("#AchievementTime").kendoDatePicker({
            format: "yyyy-MM-01",
            value: new Date()
        });

        $("#ChargingDate").kendoDatePicker({
            format: "yyyy-MM-dd"
         
        });
        $("#RebateTime").kendoDatePicker({
            format: "yyyy-MM-dd"
        });
        $("#InvoiceType").change(function () {
            CalRate();
        });
        $("#GuaranteeType").change(function () {
            showDL();
        });
        showDL();
        $("#BillType").val("@Model.Amount");
        $("#ContractType").val("@Model.Amount");
        var kendo = $("#FormDate").data("kendoDatePicker");
        var formStatus = $("#hStatus").val();

        var ProccessActiveContainerList = $(".ProccessActiveContainer");
        if (ProccessActiveContainerList.length > 0) {
            $.each(ProccessActiveContainerList, function (i, item) {
                var divId = $(item).attr("id");
                var frmID = divId.slice(3);
                $("#" + frmID).appendTo(item);
                $("#" + frmID + " select").attr("disabled", "disabled");
                $("#" + frmID + " input").attr("disabled", "disabled");
                $("#" + frmID).show();
            });
            $(".curentContainer form select").removeAttr("disabled");
            $(".curentContainer form input").removeAttr("disabled");
        }
        var CheckState = $("#divfrmBeforePresidentCheckState").val();
        var CheckContent = $("#divfrmBeforePresidentCheckContent").val();
        $("#txtCheckContent").val(CheckContent);
        if (CheckState == 2) {
            $("input[type=radio][id=txtCheckState][value=1]").attr("checked", false);
            $("input[type=radio][id=txtCheckState][value=2]").attr("checked", true);
        } else {
            $("input[type=radio][id=txtCheckState][value=1]").attr("checked", true);
            $("input[type=radio][id=txtCheckState][value=2]").attr("checked", false);
            
        }
    });

    function applyUserChange()
    {
        var formTitle = $("#hFormTitle").val();
        var applyUser = $("#ApplyUser").val();
        var Amount = $("#Amount").val();
        $("#txtFormTitle").val(formTitle + "--" + applyUser + " 标的金额" + Amount);

    }

    function Save() {
        var formStatus = $("#hStatus").val();
        if (formStatus == "0" || formStatus == "1") {
            var flag = $('#frm').validationEngine('validate');
            if (!flag) return false;
            GetProcessCheckUser(null, null, function (selectPostList) {
                if (selectPostList != null || selectPostList != undefined) {
                    var arr = new Array();
                    $.each(selectPostList.UserIDList, function (i, item) {
                        var obj = new Object();
                        obj.Key = item.UserID;
                        obj.Value = item.Name;
                        arr.push(obj);
                    });
                    selectPostList.UserIDList = arr;
                    var checkUserList = selectPostList;
                    if (checkUserList == null) return;

                    var FormConditionValue = JSON.stringify(GetFormCondition());
                    var options = {
                        data: {
                            FormAttachement: GetFormAttachement(), FormsRelation: GetFormsRelation(),
                            CheckLogUser: JSON.stringify(checkUserList.UserIDList),
                            NextActivityGuid: checkUserList.ActivityGuid, FormConditionValue: FormConditionValue
                        },
                        success: function (data) {
                            alert("表单发送成功");
                            window.close();
                        }
                    };
                    $("#hStatus").val("2");
                    $("#frm").ajaxSubmit(options);
                }
            });
        }
        else {
            submitCheckLog();
        }
    }
    function SaveAsDraft() {
        var flag = $('#frm').validationEngine('validate');
        var options = {
            data: { FormAttachement: GetFormAttachement(), FormsRelation: GetFormsRelation() },
            success: function (data) {
                alert("保存成功");
                window.close();
            }
        };
            $("#hStatus").val("1");
            $("#frm").ajaxSubmit(options);
        }
    function CalRate(){
        var Amount = $("#Amount").val();
        // 合同收款
        var ContractAmount = $("#ContractAmount").val();
        var Rate = (ContractAmount * 1.0) / Amount * 100;
        $("#Rate").val(Rate.toFixed(2));

        var ActualCharge = $("#ActualCharge").val();
        var ActualRate = (ActualCharge * 1.0) / Amount * 100;
        $("#ActualRate").val(ActualRate.toFixed(2));

        // 应付佣金=合同收款-实际收费

        var PayableAmount = ContractAmount - ActualCharge;

         $("#PayableAmount").val(PayableAmount.toFixed(2));

        var ActualRate = (ActualCharge * 1.0) / Amount * 100;
        $("#ActualRate").val();

        var InvoiceType = $("#InvoiceType").val()
        // 不开发票  shui税费= 0 实付佣金= 应付拥挤
        if (InvoiceType == 0) {
            $("#showStatus").attr("style", "display:none");
            $("#Taxation").val(0);
            $("#PaidAmount").val(PayableAmount);
        }
        // 开发票  使用应付佣金计算税费= 应付佣金 * 0.1 实付佣金= 应付佣金
        if (InvoiceType == 1) {
            $("#showStatus").attr("style", "");
            $("#Taxation").val(PayableAmount * 0.1);
            $("#PaidAmount").val(PayableAmount *0.9);
        }

        //开发票  使用合同收款 计算税费= 应付佣金 * 0.1 实付佣金= 应付佣金
        if (InvoiceType == 2) {
            $("#showStatus").attr("style", "");
            $("#Taxation").val(ContractAmount * 0.1);
            $("#PaidAmount").val(PayableAmount - ContractAmount * 0.1);
        }

    }

    // 金额 和实际费率算 实际收费
    function CalRate1() {
        var Amount = $("#Amount").val();
        var Rate = $("#Rate").val();
        var ContractAmount = Amount * Rate * 0.01;
        $("#ContractAmount").val(ContractAmount.toFixed(2));
        CalRate();
    }

    // 金额 和费率算 收费
    function CalRate12() {
        var Amount = $("#Amount").val();
        var ActualRate = $("#ActualRate").val();
        var ActualCharge = Amount * ActualRate * 0.01;
        $("#ActualCharge").val(ActualCharge.toFixed(2));
        CalRate();
    }

    function showDL() {
        if ($("#GuaranteeType ").val() == "一般案件") {
            $(".showBX").attr("style", "display:none");
            $(".showLB").attr("style", "display:none");
            $(".showLBBX").attr("style", "display:none");
        }
        if ($("#GuaranteeType ").val() == "联保案件") {
            $(".showBX").attr("style", "display:none");
            $(".showLB").attr("style", "");
            $(".showLBBX").attr("style", "");
            $("#tdgongs").html("合作的联保公司名称:");
            
        }
        if ($("#GuaranteeType ").val() == "保险案件") {
            $(".showBX").attr("style", "");
            $(".showLB").attr("style", "display:none");
            $(".showLBBX").attr("style", "");
            $("#tdgongs").html("合作的保险公司名称:");
        }
    }

    function addUsers() {
        var url = '@Url.Action("EmployeeSelect", "Employee")';
        OpenSelectUserPop(url, RefreshValue);
    }
    function RefreshValue(selectPostList) {
        if (selectPostList != null || selectPostList != undefined) {
            var strNames = "";
            var strUserIDs = "";
            $.each(selectPostList, function (i, val) {
                strNames = val.Name;
                strUserIDs = val.UserID;
                $("#ShowSalesman").val(strNames);
                $("#Salesman").val(strUserIDs);
            });
        }
    }

    function addHeadUsers() {
        var url = '@Url.Action("EmployeeSelect", "Employee")';
        OpenSelectUserPop(url, RefreshHeadValue);
    }
    function RefreshHeadValue(selectPostList) {
        if (selectPostList != null || selectPostList != undefined) {
            var strNames = "";
            var strUserIDs = "";
            $.each(selectPostList, function (i, val) {
                strNames = val.Name;
                strUserIDs = val.UserID;
                $("#HeadName").val(strNames);
                $("#HeadID").val(strUserIDs);
            });
        }
    }
    function addAUsers() {
        var url = '@Url.Action("EmployeeSelect", "Employee")';
        OpenSelectUserPop(url, RefreshAValue);
    }
    function RefreshAValue(selectPostList) {
        if (selectPostList != null || selectPostList != undefined) {
            var strNames = "";
            var strUserIDs = "";
            $.each(selectPostList, function (i, val) {
                strNames = val.Name;
                strUserIDs = val.UserID;
                $("#AName").val(strNames);
                $("#RoleAID").val(strUserIDs);
            });
        }
    }

    function addBUsers() {
        var url = '@Url.Action("EmployeeSelect", "Employee")';
        OpenSelectUserPop(url, RefreshBValue);
    }
    function RefreshBValue(selectPostList) {
        if (selectPostList != null || selectPostList != undefined) {
            var strNames = "";
            var strUserIDs = "";
            $.each(selectPostList, function (i, val) {
                strNames = val.Name;
                strUserIDs = val.UserID;
                $("#BName").val(strNames);
                $("#RoleBID").val(strUserIDs);
            });
        }
    }

    function createApplyGuarantee()
    {
        var ApplyUser = $("#ApplyUser").val();
        var Respondent = $("#Respondent").val();
        var CauseOfAction = $("#CauseOfAction").val();
        var ApplyGuarantee = ApplyUser + "诉" + Respondent + CauseOfAction + "纠纷一案";
        $("#ApplyGuarantee").val(ApplyGuarantee);
    }
</script>


